﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hangout.Cloud.Agent.Core
{
    class Meetup
    {
        static Web.Model.HangoutDBEntities context = new Web.Model.HangoutDBEntities();
        internal static void HagnoutAdded(int hangoutid, int userId)
        {

            Web.Model.UserProfile profile = Web.Core.Accounts.User.GetUserProfile(userId, context);
            Web.Model.Hangouts hangout = Web.Core.Meetup.Meetup.GetHangout(hangoutid, ref context);
            List<int> userIds = Web.Core.Compatibility.Compatibility.GetCompatibleUsers(userId, context);
            Web.Core.Notifications.Notification.AddNotification(userIds, profile.Name+" shouted " + hangout.StatusText.Substring(0, Math.Min(20, hangout.StatusText.Length - 1)) + "...", "Hangout:" + hangout.HangoutID, ref context);
        }
    }
}
